package com.zenithmind.document.pojo.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zenithmind.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 * 文档分享实体类
 * 
 * @author ZenithMind Team
 * @since 2025-01-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("document_share")
@Schema(description = "文档分享实体")
public class DocumentShare extends BaseEntity {

    /**
     * 文档ID
     */
    @TableField("document_id")
    @Schema(description = "文档ID")
    private String documentId;

    /**
     * 分享码
     */
    @TableField("share_code")
    @Schema(description = "分享码")
    private String shareCode;

    /**
     * 分享链接
     */
    @TableField("share_url")
    @Schema(description = "分享链接")
    private String shareUrl;

    /**
     * 分享标题
     */
    @TableField("title")
    @Schema(description = "分享标题")
    private String title;

    /**
     * 分享描述
     */
    @TableField("description")
    @Schema(description = "分享描述")
    private String description;

    /**
     * 分享类型（1:公开链接, 2:密码保护, 3:指定用户）
     */
    @TableField("share_type")
    @Schema(description = "分享类型")
    private Integer shareType;

    /**
     * 访问密码
     */
    @TableField("access_password")
    @Schema(description = "访问密码")
    private String accessPassword;

    /**
     * 权限设置（1:仅查看, 2:可下载, 3:可编辑）
     */
    @TableField("permission")
    @Schema(description = "权限设置")
    private Integer permission;

    /**
     * 过期时间
     */
    @TableField("expire_time")
    @Schema(description = "过期时间")
    private LocalDateTime expireTime;

    /**
     * 最大访问次数
     */
    @TableField("max_access_count")
    @Schema(description = "最大访问次数")
    private Integer maxAccessCount;

    /**
     * 当前访问次数
     */
    @TableField("access_count")
    @Schema(description = "当前访问次数")
    private Integer accessCount;

    /**
     * 下载次数
     */
    @TableField("download_count")
    @Schema(description = "下载次数")
    private Integer downloadCount;

    /**
     * 状态（0:禁用, 1:启用, 2:已过期）
     */
    @TableField("status")
    @Schema(description = "状态")
    private Integer status;

    /**
     * 分享者ID
     */
    @TableField("sharer_id")
    @Schema(description = "分享者ID")
    private String sharerId;

    /**
     * 最后访问时间
     */
    @TableField("last_access_time")
    @Schema(description = "最后访问时间")
    private LocalDateTime lastAccessTime;
}
